LogoutPortlet = Class.extend({
	init: function()	{
		this.name = "LogoutPortlet";
	},
	
	run: function()	{
		this.onAjax('user', 'logout', {}, 'POST', {
			'onSuccess': function(ret)	{
				var properties = SingletonFactory.getInstance(Application).getSystemProperties();
				properties.set('user.login', 0, true);
				var subject = SingletonFactory.getInstance(Subject);
				subject.notifyEvent('RequestRoute', new Request('Home'));
			}
		});
	}	
}).implement(PortletInterface).implement(RenderInterface).implement(AjaxInterface);